﻿namespace Grove.Cards.Usg
{
	using System.Collections.Generic;
	using Grove.Core;
	using Grove.Core.Ai;
	using Grove.Core.Details.Cards.Effects;
	using Grove.Core.Details.Cards.Modifiers;
	using Grove.Core.Details.Cards.Triggers;
	using Grove.Core.Dsl;

	public class CaveTiger : CardsSource
  {
    public override IEnumerable<ICardFactory> GetCards()
    {
      yield return C.Card
        .Named("Cave Tiger")
        .ManaCost("{2}{G}")
        .Type("Creature Cat")
        .InSets("Urza's Saga")
        .Text("Whenever Cave Tiger becomes blocked by a creature, Cave Tiger gets +1/+1 until end of turn.")
        .FlavorText(
          "The druids found a haven in the cool limestone tunnels beneath Argoth. The invaders found only tigers.")
        .Power(2)
        .Toughness(2)
        .Timing(Timings.Creatures())
        .Abilities(
          C.TriggeredAbility(
            "Whenever Cave Tiger becomes blocked by a creature, Cave Tiger gets +1/+1 until end of turn.",
            C.Trigger<GetsBlocked>(),
            C.Effect<ApplyModifiersToSelf>(p => p.Effect.Modifiers(
              p.Builder.Modifier<AddPowerAndToughness>(m =>
                {
                  m.Power = 1;
                  m.Toughness = 1;
                }, untilEndOfTurn: true))), triggerOnlyIfOwningCardIsInPlay: true)
        );
    }
  }
}